const filters={
  //格式化日期为“yyyy-MM-dd hh:mm:ss”
  formatDate:function(value) {
    if (value==null) return "--"
    var time = new Date(+value);
    var rightTwo = (v) => {
      v = '0' + v
      return v.substring(v.length - 2, v.length)
    }
    if (time == null) return ;
    var year = time.getFullYear();
    var month = time.getMonth() + 1;
    var date = time.getDate();
    var hours = time.getHours();
    var minutes = time.getMinutes();
    var seconds = time.getSeconds();
    return year + '-' + rightTwo(month) + '-' + rightTwo(date) + ' ' + rightTwo(hours) + ':' + rightTwo(minutes) + ':' + rightTwo(seconds);
  },

  //格式化日期为“yyyy-MM-dd”
  formatDates:function(value) {
    if (value==null) return "--"
    var time = new Date(+value);
    var rightTwo = (v) => {
      v = '0' + v
      return v.substring(v.length - 2, v.length)
    }
    if (time == null) return ;
    var year = time.getFullYear();
    var month = time.getMonth() + 1;
    var date = time.getDate();
    return year + '-' + rightTwo(month) + '-' + rightTwo(date);
  },
  //格式化日期为“yyyy-MM”
  formatDatess:function(value) {
    if (value==null) return "--"
    var time = new Date(+value);
    var rightTwo = (v) => {
      v = '0' + v
      return v.substring(v.length - 2, v.length)
    }
    if (time == null) return ;
    var year = time.getFullYear();
    var month = time.getMonth() + 1;
    return year + '-' + rightTwo(month);
  },
//格式化日期为“yyyy-MM-dd hh:mm”
  formatDateo:function(value) {
    if (value==null) return "--"
    var time = new Date(+value);
    var rightTwo = (v) => {
      v = '0' + v
      return v.substring(v.length - 2, v.length)
    }
    if (time == null) return ;
    var year = time.getFullYear();
    var month = time.getMonth() + 1;
    var date = time.getDate();
    var hours = time.getHours();
    var minutes = time.getMinutes();
    return year + '-' + rightTwo(month) + '-' + rightTwo(date) + ' ' + rightTwo(hours) + ':' + rightTwo(minutes);
  },
  //格式化日期为“yy-MM-dd hh:mm”
  formatDateo1:function(value) {
    if (value==null) return "--"
    var time = new Date(+value);
    var rightTwo = (v) => {
      v = '0' + v
      return v.substring(v.length - 2, v.length)
    }
    if (time == null) return ;
    var year = time.getFullYear();
    var month = time.getMonth() + 1;
    var date = time.getDate();
    var hours = time.getHours();
    var minutes = time.getMinutes();
    return year + '-' + rightTwo(month) + '-' + rightTwo(date) + ' ' + rightTwo(hours) + ':' + rightTwo(minutes);
  },
  //格式化日期为“yyyyMM”
  formatDatesss:function(value) {
    if (value==null) return "--"
    var time = new Date(+value);
    var rightTwo = (v) => {
      v = '0' + v
      return v.substring(v.length - 2, v.length)
    }
    if (time == null) return ;
    var year = time.getFullYear();
    var month = time.getMonth() + 1;
    return year + rightTwo(month);
  },
  customType(value){
      switch (value){
        case '1': return "供应商" 
        case '2': return "买方"
        case '3': return "供应商和买方"
        case '4': return "代理方"
        case '0': return "待确认"
        default: return "--"
      }
  },
  productType(val){
      switch (val){
          case '1': return "地产类" 
          case '2': return "政信类"
          default: return "--"
        }
    },
  duifuWay(val){
      switch (val){
          case '1': return "年" 
          case '2': return "半年"
          case '3': return "季度"
          case '4': return "自然季度"
          case '5': return "自然半年付息"
          case '6': return "一次性到期本息"
          default: return "--"
        } 
    },
   propertyType(val){
      switch (val){
          case '1': return "定向融资类" 
          case '2': return "商票资产类"
          case '3': return "应收账款类"
          case '4': return "其他类"
          default: return "--"
        }
    }, 
    financingSubjectNature(val){ 
      switch (val){
          case '1': return "政信" 
          case '2': return "地产"
          case '3': return "国企"
          case '4': return "其他行业龙头"
          default: return "--"
        }
    }, 
    increasingCreditMode(val){  
      switch (val){
          case '1': return "保证担保" 
          case '2': return "差额补足"
          case '3': return "保证兑付"
          case '4': return "应收确权"
          case '5': return "其他"
          default: return "--"
        }
    }, 
    collectionAmtType(val){  
      switch (val){
          case '1': return "场内" 
          case '2': return "场外" 
          case '3': return "场内和场外" 
          default: return "--"
        }
    }, 
    way_of_duifu(val){
      switch (val){
        case '1' : return '年'
        case '2' : return '半年'
        case '3' : return '季度'
        case '4' : return '自然季度'
        case '5' : return '自然半年付息'
        case '6' : return '一次性到期本息'
        default: return "--"
      } 
    },
    //客户提交form 审核状态
    auditStatus(val){
      switch (val){  
        case '0' : return '待审核'
        case '1' : return '审核中'
        case '2' : return '审核通过'
        case '3' : return '审核未通过' 
        default: return "--"
      } 
    },  
    increasingCreditMode(val){
      switch (val){   
        case '1' : return '保证担保'
        case '2' : return '差额补足'
        case '3' : return '保证兑付' 
        case '4' : return '应收确权' 
        case '5' : return '其他' 
        default: return "--"
      } 
    },
     
}
export default filters;